<?php
$siteInfo = SiteInfo::model()->findAll();
$siteInfo = CHtml::listData($siteInfo, 'key', 'value');

$siteSetting = SiteSetting::model()->findAll();
$siteSetting = CHtml::listData($siteSetting, 'key', 'value');

$criteria = new CDbCriteria();
$criteria->limit = 8;
$criteria->order = 'sorter ASC';
$criteria->order = 'date_created DESC';
$product = Product::model()->findAllByAttributes(array('is_feature' => 1, 'status' => 1), $criteria);
?>
	   <div class="spotlight">
            <div id="home-slider" class="oeSlider">
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/slider/1.jpg" alt="Slide Image"/>
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/slider/2.jpg" alt="Slide Image">
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/slider/3.jpg" alt="Slide Image">
            </div>
            <div class="spl-info">
                <h2><?php echo isset($siteInfo['site_short_name']) ? $siteInfo['site_short_name'] : 'siteInfo:site_short_name'; ?></h2>
                <p><?php echo isset($siteInfo['short_about']) ? $siteInfo['short_about'] : 'siteInfo:short_about'; ?></p>
            </div>
        </div><!-- /.spotlight -->
        <section class="main-content container">
            <article class="home-block">
                <div class="ha-text">
                    <h3 class="title-bar"><a href="#"><?php echo isset($siteSetting['home_title_bar_1']) ? $siteSetting['home_title_bar_1'] : 'siteSetting:home_title_bar_1'; ?></a></h3>
                    <?php echo isset($siteSetting['home_short_about']) ? $siteSetting['home_short_about'] : 'siteSetting:home_short_about'; ?>
                </div>
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/thumb1.jpg" alt="Giới thiệu về Mai Hoàng" class="ha-thumb"/>
                <div class="clear"></div>
            </article>
            <div class="home-block">
                <h3 class="title-bar"><a href="#"><?php echo isset($siteSetting['home_title_bar_2']) ? $siteSetting['home_title_bar_2'] : 'siteSetting:home_title_bar_2'; ?></a></h3>
                <div class="hp-house clearfix">
                	<?php if($product): foreach ($product as $p): ?>
                    <section class="hp-box">
                        <a href="/product/detail/id/<?php echo $p->id ?>" class="hp-thumb"><img src="<?php echo Yii::app()->baseUrl . $p->thumbnail ?>" alt=""></a>
                        <h2 class="hp-title"><a href="/product/detail/id/<?php echo $p->id ?>"><?php echo $p->title ?></a></h2>
                        <div class="hp-desc">
                            <p><?php echo $p->quote ?></p>
                            <a href="/product/detail/id/<?php echo $p->id ?>" class="hp-btn">Xem thêm</a>
                        </div>
                    </section><!-- /.hp-box -->
                    <?php endforeach; endif; ?>
                </div><!-- /.hp-house -->
            </div>
            <div class="clear"></div>
        </section><!-- /.main-content -->